﻿using System;
using SSP.Api.Options;

namespace SSP.Api
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class DirectorFormat : DirectorWrapper
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DirectorFormat"/> class.
        /// </summary>
        /// <param name="director">The director.</param>
        public DirectorFormat(Director director) : base(director)
        {
        }

        /// <summary>
        /// Add a format to the request. Takes a required options parameter describing the format to be returned.
        /// </summary>
        /// <param name="option">The option.</param>
        public void Add(ImageOptions option)
        {
            Parent.Sizes.Add(option);
        }

        /// <summary>
        /// Used before a call is made with the User class. Specifies how to return user profile photos.
        /// </summary>
        /// <param name="option">The option.</param>
        public void User(UserOptions option)
        {
            Parent.UserSizes.Add(option);
        }

        /// <summary>
        /// Similar to add(), but instead specifies the format for the album preview.
        /// </summary>
        /// <param name="option">The option.</param>
        public void Preview(PreviewOptions option)
        {
            Parent.preview = option;
        }

        /// <summary>
        /// Clears the current format settings. Useful if you need to make a separate request with different options.
        /// </summary>
        public void Clear()
        {
            Parent.Sizes.Clear();
            Parent.UserSizes.Clear();
            Parent.preview = new PreviewOptions();
        }
    }
}